package com.gs.jmx;

import org.springframework.jmx.export.annotation.ManagedResource;

public class JmxDynamicBean {
	private String dynamicName;
	private int dynamicAge;
	private String dynamicDescription;
	public String getName() {
		return dynamicName;
	}
	public void setDynamicName(String name) {
		this.dynamicName = name;
	}
	public int getDynamicAge() {
		return dynamicAge;
	}
	public void setDynamicAge(int age) {
		System.out.println("Changing description...");
		setDynamicDescription(dynamicName + " " + age + " years old.");
		this.dynamicAge = age;
	}
	public String getDynamicDescription() {
		return dynamicDescription;
	}
	public void setDynamicDescription(String description) {
		this.dynamicDescription = description;
	}
	public int add(int x,int y){
		return x+y;
	}
	public void dontExposeMe() {
        throw new RuntimeException();
    }
	@Override
	public String toString() {
		return "JmxBean [name=" + dynamicName + ", age=" + dynamicAge + ", description="
				+ dynamicDescription + "]";
	}	
}
